/* Copyright (c) Soon.Liao 2024. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * Create Date : 2024
 * @Date: 2024-10-14 07:57:06
 * @LastEditors: soon.liao
 * @LastEditTime: 2024-10-26 14:07:12
 * @FilePath: /src/application/ws63/rgb_master/keyValue/key_value.h
 * @Description: NA
 * NA
 */
#ifndef KEY_VALUE_H
#define KEY_VALUE_H

#include <stdint.h>
#include <stdlib.h>
#include "key_id.h"
#include "nv_common_cfg.h"

#define NV_WRITE_DELAY_TIME_MS 200

#define NV_KEYVALUE_MAX_LENGTH 128
#define NV_ID_RGB_MASTER_OFFSET 0x100

#define NV_ID_RGB_MASTER_WIFI_INFO (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 1)
#define NV_ID_RGB_MASTER_ON_OFF (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 2)
#define NV_ID_RGB_MASTER_LED_NUM (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 3)
#define NV_ID_RGB_MASTER_BRIGHTNESS (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 4)
#define NV_ID_RGB_MASTER_SENCE_ID (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 5)
#define NV_ID_RGB_MASTER_MODE_ID (NV_ID_USER_NORMAL_AREA_START + NV_ID_RGB_MASTER_OFFSET + 6)

#ifdef __cplusplus
extern "C" {
#endif
uint32_t key_value_rgb_master_wifi_info_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_wifi_info_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_wifi_info_delete(void);
uint32_t key_value_rgb_master_on_off_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_on_off_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_on_onff_delete(void);
uint32_t key_value_rgb_master_led_number_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_led_number_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_led_number_delete(void);
uint32_t key_value_rgb_master_led_brightness_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_led_brightness_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_led_brightness_delete(void);
uint32_t key_value_rgb_master_sence_id_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_sence_id_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_sence_id_delete(void);
uint32_t key_value_rgb_master_mode_id_write(const uint8_t *kvalue, uint16_t kvalue_length);
uint32_t key_value_rgb_master_mode_id_read(uint8_t *kvalue, uint16_t *kvalue_length);
uint32_t key_value_rgb_master_mode_id_delete(void);

#ifdef __cplusplus
}
#endif
#endif